"use strict";
exports.__esModule = true;
exports.metricsNameUserVital = exports.metricsName = void 0;
// store.ts
var metricsName;
(function (metricsName) {
    // web-vital
    metricsName["FP"] = "first-paint";
    metricsName["FCP"] = "first-contentful-paint";
    metricsName["LCP"] = "largest-contentful-paint";
    metricsName["FID"] = "first-input-delay";
    metricsName["CLS"] = "cumulative-layout-shift";
    metricsName["NT"] = "navigation-timing";
    metricsName["RF"] = "resource-flow";
})(metricsName = exports.metricsName || (exports.metricsName = {}));
var metricsNameUserVital;
(function (metricsNameUserVital) {
    // user-vital
    metricsNameUserVital["PI"] = "page-information";
    metricsNameUserVital["OI"] = "origin-information";
    metricsNameUserVital["RCR"] = "router-change-record";
    metricsNameUserVital["CBR"] = "click-behavior-record";
    metricsNameUserVital["CDR"] = "custom-define-record";
    metricsNameUserVital["HT"] = "http-record";
})(metricsNameUserVital = exports.metricsNameUserVital || (exports.metricsNameUserVital = {}));
// Map 暂存数据
var metricsStore = /** @class */ (function () {
    function metricsStore() {
        this.state = new Map();
    }
    metricsStore.prototype.set = function (key, value) {
        this.state.set(key, value);
    };
    metricsStore.prototype.add = function (key, value) {
        var keyValue = this.state.get(key);
        this.state.set(key, keyValue ? keyValue.concat([value]) : [value]);
    };
    metricsStore.prototype.get = function (key) {
        return this.state.get(key);
    };
    metricsStore.prototype.has = function (key) {
        return this.state.has(key);
    };
    metricsStore.prototype.clear = function () {
        this.state.clear();
    };
    metricsStore.prototype.getValues = function () {
        // Map 转为 对象 返回
        return Object.fromEntries(this.state);
    };
    return metricsStore;
}());
exports["default"] = metricsStore;
